package codigoObjeto;

public class Registers {
	private String name;
	private final String R = "R";
	private static int currentPosition = 0;
	private static int methodPosition = 900;
	
	public Registers(int position) {
		this.name = R+position;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public static int getCurrentPosition() {
		return currentPosition;
	}

	public static void setCurrentPosition(int currentPosition) {
		Registers.currentPosition = currentPosition;
	}

	public String getR() {
		return R;
	}
	
	public String toString(){
		return getName();
	}
	
	public static Registers getRegister(){
		return new Registers(currentPosition++);
	}
	
	public void setMethodPosition (int methodPosition){
		this.methodPosition = methodPosition;
	}
	
	public static int getMethodPosition(){
		methodPosition += 100;
		return methodPosition;
	}
	
}
